class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table "users", :force => true do |t|    
      # Login and password
      t.column :login,                     :string      
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      
      # User role
      t.column :role,                      :integer
      
      # Fullname
      t.column :lastname,                  :string
      t.column :firstname,                 :string
      t.column :middlename,                :string
      
      # Mail
      t.column :email1,                    :string
      t.column :email2,                    :string
      
      # ICQ
      t.column :icq,                       :string
      
      # Phone Info 1
      t.column :phone1,                    :string
      t.column :sms1,                      :boolean, :default => false
      t.column :provider_url1,             :string
      
      # Phone Info 2
      t.column :phone2,                    :string
      t.column :sms2,                      :boolean, :default => false
      t.column :provider_url2,             :string
      
      # System fileds
      t.column :times_entered,             :integer, :default => 0
      t.column :now_here,                  :boolean, :default => false
      
      # Geografical info
      t.column :oragnzation_id,            :integer
      t.column :country_id,                :integer
      
      # Created and updated times
      t.column :created_at,                :datetime
      t.column :updated_at,                :datetime
      
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime
    end
  end

  def self.down
    drop_table "users"
  end
end
